package api

import (
	"github.com/gin-gonic/gin"
	"video_08_01/api/handler"
	"video_08_01/api/middleware"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
		}

		auth := api.Group("/auth")
		{
			auth.Use(middleware.Auth())
			auth.POST("addBarrage", handler.AddBarrage)
			auth.POST("list", handler.ListBarrage)
		}

	}

}
